package com.tsd.system.dao;

import com.tsd.core.vo.PageBean;
import com.tsd.system.entity.SysRole;
import com.tsd.system.entity.SysRoleExt;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 描述：SysRoleMapper
 *
 * @author Hillpool
 * @date 2019/03/12 12:20:51
 */
public interface SysRoleMapper {

    SysRole selectByPrimaryKey(Long id);

    SysRoleExt selectBySid(String sid);

    List<SysRoleExt> selectByPage(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    int deleteByPrimaryKey(Long id);

    int insert(SysRole record);

    int insertSelective(SysRole record);

    int updateByPrimaryKey(SysRole record);

    int updateByPrimaryKeySelective(SysRole record);

    SysRole selectByName(String name);

    List<SysRoleExt> listSysRole(@Param("params") Map<String, Object> params);

    List<SysRoleExt> selectByParams(@Param("params") Map<String, Object> params);

    List<SysRoleExt> selectByParentSid(String parentSid);

    List<SysRoleExt> selectRoleByUnitType(String orgTypeSid);

    List<SysRoleExt> selectRoleByUnitTypeAndGroupSid(@Param("orgTypeSid") String orgTypeSid, @Param("groupSid") String groupSid);

    List<SysRole> selectRoleByUnitType(@Param("orgTypeSid") String orgTypeSid, @Param("id") Long id);

    List<Map<String, Object>> selectParamsMapByPage(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<SysRoleExt> selectRoleGroup();

    List<SysRoleExt> select4ShiroByUserSid(@Param("user_sid") String user_sid);

    SysRoleExt selectDuplicatedRecord(SysRoleExt roleExt);

    int countValid();
}
